<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<html>
	<f:view>
		<head>
             <title>
                Change password by user
             </title>
         </head>
			<body>
             	<h:form id="changePasswordForm">
                <hr />
				<h:panelGrid columns="6">
					<h:panelGroup>
						<h:outputText value="#{changePasswordController.user.firstName}" />
						<h:outputText value="" />
					</h:panelGroup>
					<h:outputText value="&nbsp;&nbsp;-&nbsp;&nbsp;" escape="false" />
					<h:commandLink action="#{homeController.home}">
			   			<f:param value="#{changePasswordController.user.id}" name="userId" />
						<h:outputText value="Home" />
					</h:commandLink>
					<h:commandLink action="#{myEventsController.listMyEvents}">
						<f:param value="#{changePasswordController.user.id}" name="userId" />
						<h:outputText value="My Events" />
					</h:commandLink>
					<h:commandLink action="#{manageAccountController.manageAccount}">
						<f:param value="#{changePasswordController.user.id}" name="userId" />
						<h:outputText value="My Account" />
					</h:commandLink>
					<h:commandLink action="#{loginController.logout}">
						<h:outputText value="Log Out" />
					</h:commandLink>
				</h:panelGrid>
				<hr />
				<h1><h:panelGroup>
					<h:outputText value="Change Password for "/>
	      			<h:outputText value="#{changePasswordController.user.firstName}" />
				</h:panelGroup></h1>
             	<h:outputText value="<br/><br/>" escape="false"/>
                <h:outputText id="summary"/>
                <h:message for="summary" style="color: Red" />
                <h:outputText value="<br/><br/>" escape="false"/>
                <h:panelGrid columns="2">
                
                   <h:outputText value="Current password: "/> 
                   <h:panelGroup>
                      <h:inputSecret id="oldPassword"
                      				 onkeyup="checkPassword(this.value)" 
                                	 value="#{changePasswordController.currentPassword}"/>
                      <h:message for="oldPassword" style="color: Red"/>
                   </h:panelGroup>
               
                   <h:outputText value="New password: "/> 
                   <h:panelGroup>
                      <h:inputSecret id="newPWD" 
                                	 value="#{changePasswordController.newPassword}"/>
                      <h:message for="newPWD" style="color: Red"/>
                   </h:panelGroup>
                   
                   <h:outputText value="Confirm new password: "/> 
                   <h:panelGroup>
                      <h:inputSecret id="confirmPWD" 
                                	 value="#{changePasswordController.confirmPassword}"/>
					 <h:message for="confirmPWD" style="color: Red"/>
                   </h:panelGroup>
               </h:panelGrid>
             
               <h:outputText value="<br/>" escape="false"/>
               <h:panelGrid columns="2" cellspacing="15">
               <h:commandButton value=" Save " action="#{changePasswordController.savePassword}"/>
        
               <h:commandButton id="cancelButton" 
               					value="Cancel" 
               					action="#{changePasswordController.cancel}" 
               					immediate="true" />
               
               </h:panelGrid>
           </h:form>
        </body>
    </f:view>
</html>